#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>


int main()
{
	char arr[4] = "ABCD";
	int a = 0;
	int b = 0;
	int i = 0;
	int j = 0;
	scanf("%d", &a);
	a = a % 4;
	for (i = 0; i < a; i++)
	{
		char temp = arr[0];
		for (j = 0; j < 3; j++)
		{
			arr[j] = arr[j + 1];
		}
		arr[j] = temp;
	}

	for (int i = 1; i <= 4; i++)
	{
		printf("%c", arr[i - 1]);
	}
}